<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>for循环写小九九</title>
</head>
<body>
    <table border="1" cellspacing="0">
    <?php 
       for($i=1;$i<=9;$i++){
       	    if($i%2==0){
       	    	echo '<tr style="background:red;">';
       	    }else{
                echo '<tr style="background:green;">';
       	    }
       	   
       	    for($j=1;$j<=$i;$j++){             ?> 
      
       	   	        <td>
       	   	            <?php  echo  $i.'*'.$j.'='.$i*$j;   ?>
      	   	        </td>

       	    <?php } 
        
      		   echo '</tr>';
    	    }
    	   
            ?>

    </table>
	
</body>
</html>